GBML manual / Constants

WARP_SHAKE

A shake: every row jumps a little to one side or the other, as if the sprite had been hit.

Works differently on Game Boy - The Game Boy moves the two sprite pieces of a picture sideways by a different amount on every line; the picture can be 16 pixels wide and 16 tall at most, only one picture at a time is bent, and a line may show the line above's shift.

Works differently on Game Boy Color - The Game Boy Color moves the two sprite pieces of a picture sideways by a different amount on every line; the picture can be 16 pixels wide and 16 tall at most, only one picture at a time is bent, and a line may show the line above's shift.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

WARP_SHAKE: constant

<!-- GENERATED by tools/gbabel_looks.py from its LOOKS registry. Never edit this page: change the registry and re-run it. -->

Description

Names the shake, for sprite_warp. Each row of the sprite jumps to the left or the right by its own amount, picked from a pattern that repeats every 64 rows. There is no smooth wave in it, only jolts, and that is what a shake looks like.

strength is the biggest jump: 1, 2 or 3 pixels. A fast speed (try 2 or 3) makes the pattern change every frame, so the sprite buzzes. Ask for it when something is hit, and ask for WARP_NONE a few frames later.

A real capture, four pictures of the same striped lighthouse - straight, then with WARP_SHAKE at strength 1, strength 2 and strength 3 (every row jumps to its own side, so the lamp and the stripes are torn into jagged pieces) - the pattern held in the same place each timeA real capture, four pictures of the same striped lighthouse - straight, then with WARP_SHAKE at strength 1, strength 2 and strength 3 (every row jumps to its own side, so the lamp and the stripes are torn into jagged pieces) - the pattern held in the same place each time
A real capture, four pictures of the same striped lighthouse - straight, then with WARP_SHAKE at strength 1, strength 2 and strength 3 (every row jumps to its own side, so the lamp and the stripes are torn into jagged pieces) - the pattern held in the same place each time

The same picture four times: straight, then strength 1, 2 and 3 from left to right, each one standing still where the pattern had got to. Real pictures from a Game Boy Advance ROM.

speed is how many rows the pattern travels down the sprite every frame. 0 holds it still, a negative number sends it up, 0.25 is slow and 1 is quick. The pattern belongs to the sprite, not to the screen: it stays on the sprite when the sprite moves.

A real capture, 16 frames played in a loop - the lighthouse buzzes, its stripes and its lamp breaking into different jagged pieces in every pictureA real capture, 16 frames played in a loop - the lighthouse buzzes, its stripes and its lamp breaking into different jagged pieces in every picture
A real capture, 16 frames played in a loop - the lighthouse buzzes, its stripes and its lamp breaking into different jagged pieces in every picture

The pattern moving, sped up: sixteen real pictures four frames apart, played 70 milliseconds each, at strength 3. It is a whole turn of the pattern, so the loop has no seam. This picture is an animated PNG; a viewer that cannot animate shows its first frame.

Example

sprite_warp(WARP_SHAKE, 2, 0.5);

A sprite that buzzes, as if it had just been hit. Call it once, for example in the object's Create event - it keeps going by itself until you call sprite_warp(WARP_NONE, 0, 0) or the object is destroyed.

See also: sprite_warpWARP_NONEWARP_ZIGZAG